// hyb_yl/backstageServices/pages/chufangjianyi/chufangjianyi.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    y_id:"",
    xufang: "",
    counttime: "",
    copyright: [{
        imgs: "https://6a69-jin5201-a4503e-1257013711.tcb.qcloud.la/renzheng.png?sign=99d87d2d65c67c848a10aaf43bafb66e&t=1583825248",
        text: "药监认证"
      },
      {
        imgs: "https://6a69-jin5201-a4503e-1257013711.tcb.qcloud.la/people.png?sign=717fc4019448bfc2a03ac538022f7ed8&t=1583825298",
        text: "药师审核"
      },
      {
        imgs: "https://6a69-jin5201-a4503e-1257013711.tcb.qcloud.la/yinsi.png?sign=f45888dbb9b06874e8d079f99d6018f5&t=1583825342",
        text: "隐私包装"
      },
    ]
  },
  shenhe:function(e){
    var that = this;
    var id = e.currentTarget.dataset.id;
    var status = e.currentTarget.dataset.status;
    wx.showModal({
      title: '提示',
      content:"是否确认审核改订单",
      success:function(con)
      {
        if(con.confirm)
        {
          app.util.request({
            'url':"entry/wxapp/yaoshi.shenhe_order",
            data:{
              id:id,
              y_id:that.data.y_id,
              status:status
            },
            success:function(res)
            {
              wx.showToast({
                title: '审核成功',
              })
              that.setData({
                page:0,
                list:[],
              })
              setTimeout(() => {
                app.util.request({
                  url: 'entry/wxapp/user.cfdetail',
                  data: {
                    id: that.data.id
                  },
                  success: function (res) {
                    console.log(res)
                    that.setData({
                      conets: res.data.conets,
                      goodlist: res.data.sid,
                      cfimg: res.data.cfimg,
                      info:res.data
                    })
                  }
                })
              }, 500);
            }
          })
        }
      }
    })
  },
  loogchufang(e) {
    console.log(e)
    var that = this
    var id = that.data.id
    var cfimg = e.currentTarget.dataset.cfimg
    console.log(cfimg)
    app.util.request({
      url: 'entry/wxapp/user.gongzhangimg',
      data: {
        id: id,
        cfimg: cfimg
      },
      success: function (res) {
        console.log(res)
        wx.previewImage({
          urls: [res.data],
        })
      }
    })
  },
 
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    var id = options.id
    var orderStatus = options.orderStatus
    var y_id = options.y_id;
    that.setData({
      orderStatus: orderStatus,
      id: id,
      y_id:y_id,
    })
    app.util.request({
      url: 'entry/wxapp/user.cfdetail',
      data: {
        id: id
      },
      success: function (res) {
        console.log(res)
        that.setData({
          conets: res.data.conets,
          goodlist: res.data.sid,
          cfimg: res.data.cfimg,
          info:res.data
        })
      }
    })
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
    if (options.xufang) {
      this.setData({
        xufang: options.xufang
      })
    }
    that.setData({
      bgc: bgc
    })
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})